home *** CD-ROM | disk | FTP | other *** search
- *** ../dist/supscan.c Thu Dec 16 07:30:01 1993
- --- supscan.c Fri Dec 17 12:10:19 1993
- ***************
- *** 124,129 ****
- --- 124,132 ----
- #endif
- #include <sys/time.h>
- #include <sys/types.h>
- + #ifdef _ABI_SOURCE
- + #include <sys/utsname.h>
- + #endif
- #include "sup.h"
-
- #ifdef lint
- ***************
- *** 391,400 ****
- --- 394,419 ----
- int localhost (host)
- register char *host;
- {
- + #ifdef _ABI_SOURCE
- + static struct utsname myhost;
- + #else
- static char myhost[STRINGLENGTH];
- + #endif
- static int myhostlen;
- register int hostlen;
-
- + #ifdef _ABI_SOURCE
- + if (*(myhost.nodename) == '\0') {
- + /*
- + * We assume that the host name in the kernel is the
- + * fully qualified form.
- + */
- + if (uname (&myhost) < 0) {
- + quit (1,"supscan: can't get kernel host name\n");
- + }
- + myhostlen = strlen(myhost.nodename);
- + }
- + #else
- if (*myhost == '\0') {
- /*
- * We assume that the host name in the kernel is the
- ***************
- *** 405,410 ****
- --- 424,430 ----
- }
- myhostlen = strlen(myhost);
- }
- + #endif
-
- /*
- * Here, we assume that the 'host' parameter from the
- ***************
- *** 419,425 ****
- --- 439,451 ----
-
- hostlen = strlen(host);
-
- + #ifdef _ABI_SOURCE
- + return(strncasecmp (myhost.nodename,
- + host,
- + hostlen < myhostlen ? hostlen : myhostlen) == 0);
- + #else
- return(strncasecmp (myhost,
- host,
- hostlen < myhostlen ? hostlen : myhostlen) == 0);
- + #endif
- }
-